﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL_Class
{
    public class UIMenu
    {
        NLLDataContext db;
        #region "Lay thong tin Menu Workshop"
        public IEnumerable<Menu> GetMenusWorkshop() {
            db = new NLLDataContext();
            IEnumerable<Menu> menus = from m in db.Menus
                                      where (m.Position == "Hội Thảo") && (m.Status == true)
                                      orderby m.SortNumber ascending
                                      select m;
            return menus;
        }
        #endregion

        #region "Lay thong tin Menu Topic"
        public IEnumerable<Menu> GetMenusTopic(int ParrentID)
        {
            db = new NLLDataContext();
            IEnumerable<Menu> menus = from m in db.Menus
                                      where (m.Position == "Chủ Đề") && (m.ParrentID == ParrentID) && (m.Status == true)
                                      orderby m.SortNumber ascending
                                      select m;
            return menus;
        }
        #endregion

        #region "Lay thong tin Menu Top"
        public IEnumerable<Menu> GetMenusTop()
        {
            db = new NLLDataContext();
            IEnumerable<Menu> menus = from m in db.Menus
                                      where (m.Position == "Top") && (m.Status == true) 
                                      orderby m.SortNumber ascending
                                      select m;
            return menus;
        }
        #endregion
    }
}
